
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>销售数据分析</title>
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <link rel="stylesheet" type="text/css" href="view/iwocar5/css/main.css" />
	<style>
	.store-title-add{
		width: 92%;
		margin: 0 auto;
	}
	.store-title-add .pub-title {
		margin: 15px 0;
		height: 18px;
		line-height: 18px;
		border-left: 5px solid #c72220;
		padding-left: 5%;
	}
	.store-title-add p{
		background: #ce102a;
		line-height: 35px;
		padding-left: 10px;
		font-size: 16px;
	}
	</style>
	<script src="view/iwocar5/js/jquery-1.11.1.min.js"></script>	
	<script>
	$(function(){
		$("#toplist").click(function(){
			location.href="4S_Top.php?address=北京博瑞祥星汽车销售有限公司";
		})
		$("#teamstate").click(function(){
			location.href="4S_Team.php?address=北京博瑞祥星汽车销售有限公司";
		})		
	})
	</script>
</head>
<body>
<!--    <div class="header">
        <h5>销售总监<i class="arrow_l1"></i><em class="arrow_l2"></em></h5>
    </div>-->
    <!--<div class="home-data">
        <h5>数据概况</h5>
			<ul>
				<li>
					<p>当前在店总人数：<span id="l2">34</span>人</p>
					<p>当天累计总人数：<span id="l3">39</span>人</p>
				</li>
				<li>					<p>销售接待区：<span id="l4">27</span>人</p>
					<p>售后维修区：<span id="aftersale">7</span>人</p>
				</li>
				<li>
					<p>首次进店：<span id="first">5</span>人</p>
					<p>二次及以上进店：<span id="secand">29</span>人</p>
				</li>
				<li>
					<p>WIFI登录：<span id="l6">17</span>人</p>
					<p>WIFI未登录：<span id="l7">17</span>人</p>
				</li>
			</ul>
			<h6>历史累计进店总人数：<span id="l8">59915</span>人</h6>
    </div>-->
    <div class="form-bar">
        <h3 class="pub-title">
            <span>数据总览分析</span>
            <div>
                <span><i class="arrow_b"></i></span>
                <select id="xiaoliang">
                  <option value="今天" selected = "selected">今天</option>
                  <option value="本周">本周</option>
				  <option value="本月">本月</option>
				  <option value="今年">今年</option>
                </select>
            </div>
        </h3>
        <div class="form-border">
            <h3 class="form-title bar-title">
                <p>销量统计</p>
            </h3>   
            <div class="dataAnalyze-form" id="dataAnalyze1-form"></div>
        </div>
        <div class="form-border">
            <h3 class="form-title bar-title">
                <p>集客统计</p>
            </h3>   
            <div class="dataAnalyze-form" id="dataAnalyze2-form"></div>
        </div>
        <!--<div class="form-border">
            <h3 class="form-title bar-title">
                <p>集客总量与意向、成交比率</p>
            </h3>   
            <div class="dataAnalyze-form" id="dataAnalyze3-form"></div>
        </div>-->
    </div> 
    <div class="form-pie">
        <h3 class="pub-title">
            <span>进店频次分析</span>
        </h3>
        <div class="form-border">
            <h3 class="form-title">
                <p>进店频次</p>
            </h3>
            <div class="volume-from" id="volume1-from"></div>
            <h5 class="graph-title">
                <span>一次</span>
                <span>两次</span>     
                <span>三次</span>
                <span>三次以上</span>             
            </h5>
        </div>
		
		<div class="form-border" style="display:none" >
            <h3 class="form-title bar-title">
                <p>停留时长<span>单位：分钟</span></p>
                
            </h3>   
            <div class="dataAnalyze-form" id="dataAnalyze4-form"></div>
        </div>			
		
        <div class="form-border">
            <h3 class="form-title">
                <p>进店周期</p>
            </h3>
            <div class="volume-from" id="volume2-from"></div>
            <h5 class="graph-title">
                <span>一月内</span>
                <!--<span>两月内</span>-->
                <span>三月内</span>     
                <span>五月内</span>             
            </h5>
        </div>
        <div class="form-border" style="display:none">
            <h3 class="form-title">
                <p>活动参与情况</p>
            </h3>
            <div class="volume-from" id="volume3-from"></div>
            <h5 class="graph-title">
                <span>参与</span>
                <span>未参与</span>     
                <span>参与两次以上</span>    
            </h5>
        </div>
    </div>
    <div class="form-pie" style="display:none">
        <h3 class="pub-title">
            <span>成交用户精准画像</span>
        </h3>
        <div class="form-border">
            <div class="volume-from" id="volume4-from"></div>
            <h5 class="graph-title spec">
                <span>商务达人</span>
                <span>运动达人</span>     
                <span>金融人士</span><br />
                <span>公务员</span>  
                <span>专业人士</span>  
                <span>社交达人</span>             
            </h5>
        </div>
    </div>

    <div class="form-pie" style="display:none">
        <h3 class="pub-title">
            <span>金融渗透率</span>  
        </h3>
        <div class="form-border">
            <div class="volume-from" id="volume5-from"></div>
            <h5 class="graph-title">
                <span>分期付款</span>
                <span>全款购车</span>              
            </h5>
        </div>
    </div>

    <!--<ul class="home-list">
        <li id="toplist">
            <h4><img src="view/iwocar5/images/market.png" alt="" /></h4>
            <p>数据排行榜</p>
        </li>
        <li id="teamstate">
            <h4><img src="view/iwocar5/images/team.png" style="height:36px; margin-bottom:4px;" /></h4>
            <p>团队状况</p>
        </li>
    </ul>-->


<script src="http://echarts.baidu.com/build/dist/echarts.js"></script>
    <script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: 'http://echarts.baidu.com/build/dist'
            }
        });
        
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('dataAnalyze1-form')); 
                
                var option = {
                    calculable : false,
                    xAxis : [
                        {
                            type : 'category',
                            data : ['今天','昨天'],
                            axisLine: {lineStyle: {color: '#EEEEEE'}},
                            splitLine : {
                                show : false,
                            },
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            scale : true,
                            axisLine: {lineStyle: {color: '#EEEEEE'}},
                        }
                    ],
                    series : [
                        {
                            // name:'蒸发量',
                            type:'bar',
                            barCategoryGap : '80%',
                            itemStyle: {
                                normal: {
                                    color: '#434c53',
                                    label : {
                                        show: true, position: 'top',
                                        textStyle:{
                                            color : '#000',
                                        }
                                    }
                                }
                            },
                            data:[0,0]
                        }
                    ],
                    grid : {
                        x : '20%',
                        y : '15%',
                        x2 : '10%',
                        y2 : '20%'
                    }
                };
        
		$("#xiaoliang").change(function(){
						var flow_time=$("#xiaoliang").val();
						if(flow_time=="今天"){
							option.xAxis[0].data=['今天','昨天'];
							option.series[0].data =[0,0];
							option.series[0].barCategoryGap="50%";
							myChart.clear();
							myChart.hideLoading();
							myChart.setOption(option);
						}
						if(flow_time=="本周"){
							option.xAxis[0].data=['日','一','二','三','四','五','六'];
                            option.series[0].data =[
                                0,
                                0,
                                0,
                                0,
                                0,
                                0,
                                0,
                            ];
							option.series[0].barCategoryGap="50%";
							//console.log(sx);
							myChart.clear();
							myChart.hideLoading();
							myChart.setOption(option);					
							
						}
						
						if(flow_time=="本月"){
							option.xAxis[0].data=['第1周','第2周','第3周','第4周'];
                            option.series[0].data =[
                                0,
                                0,
                                0,
                                0,
                            ];
							option.series[0].barCategoryGap="60%";
							myChart.clear();
							myChart.hideLoading();
							myChart.setOption(option);
						}
						if(flow_time=="今年"){
							option.xAxis[0].data=['第一季度','第二季度','第三季度','第四季度'];
                            option.series[0].data =[
                                0,
                                0,
                                0,
                                0,];
							option.series[0].barCategoryGap="60%";
							myChart.clear();
							myChart.hideLoading();
							myChart.setOption(option);
						}						
				})
                // 为echarts对象加载数据 
                myChart.setOption(option); 
                window.onresize = myChart.resize;
            }
        );
        
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('dataAnalyze2-form')); 
                
                var option = {
                    calculable : false,
                    xAxis : [
                        {
                            type : 'category',
                            data : ['今天','昨天'],
                            axisLine: {lineStyle: {color: '#EEEEEE'}},
                            splitLine : {
                                show : false,
                            },
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            scale : true,
                            axisLine: {lineStyle: {color: '#EEEEEE'}},
                        }
                    ],
                    series : [
                        {
                            // name:'蒸发量',
                            type:'bar',
                            barCategoryGap : '80%',
                            itemStyle: {
                                normal: {
                                    color: '#434c53',
                                    label : {
                                        show: true, position: 'top',
                                        textStyle:{
                                            color : '#000',
                                        }
                                    }
                                }
                            },
                            data:[<?php echo $nowservice?>,<?php echo $yesdservice?>]
                        }
                    ],
                    grid : {
                        x : '20%',
                        y : '15%',
                        x2 : '10%',
                        y2 : '20%'
                    }
                };
                    $("#xiaoliang").change(function(){
                        var flow_time=$("#xiaoliang").val();
                        if(flow_time=="今天"){
                            option.xAxis[0].data=['今天','昨天'];
                            option.series[0].data =[<?php echo $nowservice?>,<?php echo $yesdservice?>];
                            option.series[0].barCategoryGap="80%";
                            myChart.clear();
                            myChart.hideLoading();
                            myChart.setOption(option);
                        }
                        if(flow_time=="本周"){
                            option.xAxis[0].data=['一','二','三','四','五','六','日'];
                            option.series[0].data =[
                            
                                <?php echo $onejk?>,
                                <?php echo $twojk?>,
                                <?php echo $threejk?>,
                                <?php echo $fourjk?>,
                                <?php echo $fivejk?>,
                                <?php echo $sixjk?>,
                                <?php echo $sevenjk?>,
                                
                            ];
                            option.series[0].barCategoryGap="50%";
                            //console.log(sx);
                            myChart.clear();
                            myChart.hideLoading();
                            myChart.setOption(option);                  
                            
                        }
                        
                        if(flow_time=="本月"){
                            option.xAxis[0].data=['第1周','第2周','第3周','第4周'];
                            option.series[0].data =[
                                <?php echo $firstjk?>,
                                <?php echo $secondjk?>,
                                <?php echo $thirdjk?>,
                                <?php echo $fourthjk?>,
                            ];
                            option.series[0].barCategoryGap="60%";
                            myChart.clear();
                            myChart.hideLoading();
                            myChart.setOption(option);
                        }
                        if(flow_time=="今年"){
                            option.xAxis[0].data=['第一季度','第二季度','第三季度','第四季度'];
                            option.series[0].data =[
                                <?php echo $firstmonth?>,
                                <?php echo $secondmonth?>,
                                <?php echo $thirdmonth?>,
                                <?php echo $fourthmonth?>,];
                            option.series[0].barCategoryGap="60%";
                            myChart.clear();
                            myChart.hideLoading();
                            myChart.setOption(option);
                        }                       
                })
                // 为echarts对象加载数据 
                myChart.setOption(option); 
                window.onresize = myChart.resize;
            }
        );

        //使用
        /* require(
            [
                'echarts',
                'echarts/chart/line' // 加载line模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('dataAnalyze3-form')); 
                
                var option = {
                        calculable : true,
                        color : ["#4f81bd"],
                        xAxis : [
                            {
                                type : 'category',
                                boundaryGap : false,
                                data : ['接待总量','意向客户占比','成交客户占比'],
                                axisLine: {lineStyle: {color: '#EEEEEE'}},
                                splitLine : {show : false,}
                            }
                        ],
                        yAxis : [
                            {
                                type : 'value',
                                axisLabel : {
                                    formatter: '{value}%'  //为y轴添加单位
                                },
                                axisLine: {lineStyle: {color: '#EEEEEE'}},
                            }
                        ],
                        series : [
                            {
                                type:'line',
                                itemStyle: {
                                    normal: {
                                        color: '#000',
                                        label : {
                                            show: true, position: 'right',
                                        textStyle:{
                                            color : '#000',
                                        }
                                        }
                                    }
                                },
                                data:[100,25,12]
                            }
                        ],
                    grid : {
                        x : '20%',
                        y : '15%',
                        x2 : '13%',
                        y2 : '20%'
                    }
                    };                                   
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option);
                window.onresize = myChart.resize;
            }
        ); */

        // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie' // 加载pie模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('volume1-from')); 
                
                var option = {
                        color : ["#c00000",'#434c53','#6d7578','#b1b6b9'],
                        series : [
                            {
                                type:'pie',
                                itemStyle : {
                                    normal : {
                                        label : {
                                            position : 'inner'
                                        },
                                        labelLine : {
                                            show : false
                                        }
                                    }
                                },
                                data:[
                                    {value:<?php echo $vone?>, name:"<?php echo $vone?>%"},
                                    {value:<?php echo $vtwo?>, name:'<?php echo $vtwo?>%'},
                                    {value:<?php echo $vthree?>, name:'<?php echo $vthree?>%'},
                                    {value:<?php echo $vmore?>, name:'<?php echo $vmore?>%'},
                                ]
                            }
                        ]
                    };
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option); 
                window.onresize = myChart.resize;
            }
        );

        // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie' // 加载pie模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('volume2-from')); 
                
                var option = {
                        color : ["#c00000",'#434c53','#6d7578','#b1b6b9'],
                        series : [
                            {
                                type:'pie',
                                itemStyle : {
                                    normal : {
                                        label : {
                                            position : 'inner'
                                        },
                                        labelLine : {
                                            show : false
                                        }
                                    }
                                },
                                data:[
                                    {value:63, name:'63%'},
                                    {value:30, name:'30%'},
                                    {value:7, name:'7%'},
                                ]
                            }
                        ]
                    };
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option); 
                window.onresize = myChart.resize;
            }
        );

        // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie' // 加载pie模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('volume3-from')); 
                
                var option = {
                        color : ["#c00000",'#434c53','#6d7578'],
                        series : [
                            {
                                type:'pie',
                                itemStyle : {
                                    normal : {
                                        label : {
                                            position : 'inner'
                                        },
                                        labelLine : {
                                            show : false
                                        }
                                    }
                                },
                                data:[
                                    {value:37, name:'37%'},
                                    {value:46, name:'46%'},
                                    {value:17, name:'17%'},
                                ]
                            }
                        ]
                    };
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option); 
                window.onresize = myChart.resize;
            }
        );

        // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie' // 加载pie模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('volume4-from')); 
                
                var option = {
                        color : ['#c00000','#000',"#434c53",'#6d7578',"#b1b6b9",'#d5d9d8'],
                        series : [
                            {
                                type:'pie',
                                itemStyle : {
                                    normal : {
                                        label : {
                                            position : 'inner'
                                        },
                                        labelLine : {
                                            show : false
                                        }
                                    }
                                },
                                data:[
                                    {value:10, name:'10%'},
                                    {value:20, name:'20%'},
                                    {value:15, name:'15%'},
                                    {value:43, name:'30%'},
                                    {value:12, name:'12%'},
                                    {value:12, name:'13%'},
                                ]
                            }
                        ]
                    };
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option); 
                window.onresize = myChart.resize;
            }
        );

        // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie' // 加载pie模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('volume5-from')); 
                
                var option = {
                        color : ["#c00000",'#434c53'],
                        series : [
                            {
                                type:'pie',
                                itemStyle : {
                                    normal : {
                                        label : {
                                            position : 'inner'
                                        },
                                        labelLine : {
                                            show : false
                                        }
                                    }
                                },
                                data:[
                                    {value:60, name:'60%'},
                                    {value:40, name:'40%'},
                                ]
                            }
                        ]
                    };
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option); 
                window.onresize = myChart.resize;
            }
        );
//进店停留时长
        require(
            [
                'echarts',
                'echarts/chart/line' // 加载line模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('dataAnalyze4-form')); 
                
                var option = {
                        calculable : true,
                        color : ["#4f81bd"],
                        xAxis : [
                            {
                                type : 'category',
                                boundaryGap : false,
                                data : ['9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00'],
                                axisLine: {lineStyle: {color: '#EEEEEE'}},
                                splitLine : {show : false,},
								axisLabel : {textStyle : {fontSize : 6,}}
                            }
                        ],
                        yAxis : [
                            {
                                type : 'value',
                                // axisLabel : {
                                //     formatter: '{value}%'  //为y轴添加单位
                                // },
                                axisLine: {lineStyle: {color: '#EEEEEE'}},
                            }
                        ],
                        series : [
                            {
                                type:'line',
                                itemStyle: {
                                    normal: {
                                        color: '#4D545A',
                                        label : {
                                            show: true, position: 'top',
                                        textStyle:{
                                            color : '#000',
                                        }
                                        }
                                    }
                                },
                                data:[
0,0,0,0,0,0,0,0,0,0								
								]
                            }
                        ],
                    grid : {
                        x : '15%',
                        y : '15%',
                        x2 : '13%',
                        y2 : '20%'
                    }
                    };                                   
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option);
                window.onresize = myChart.resize;
            }
        );		
</script>
</body>
</html>